import request from '@/utils/request';

/**
 * 获取用户信息
 */
export const fetchUserService = async (data: {} = {}, params: {} = {}) =>
  request('/student/user/current', {
    data,
    params,
  });

/**
 * 更新用户信息
 */
 export const updateUser = async (data: {} = {}, params: {} = {}) =>
 request('/student/user/update', {
   data,
   params,
 });  
  
/**
 * 获取分享信息
 */
export const shareInfo = async (data: {} = {}, params: {} = {}) =>
  request('/share/info', {
    data,
    params,
    method: 'get',
  });


/**
 * 短信登录
 */
export const loginByCode = async (data: {} = {}, params: {} = {}) =>
  request(`/loanBuy/new/validateCode`, {
    data,
    params,
    requestType:'form'
  });

/**
 * 短信登录
 */
 export const userLogin = async (data: {} = {}, params: {} = {}) =>
 request(`/user/login`, {
   data,
   params,
 });  

/**
 * 查询邮编
 */
export const queryZipcode = async (params: {
  provinceName: string;
  cityName: string;
  areaName: string;
}) =>
  request(`/basic/code/queryZipcode`, {
    params,
    method: 'get',
  });

/**
 * 退出
 */
 export const userLogout = async (data: {} = {}, params: {} = {}) =>
 request(`/user/logout`, {
   data,
   params,
 });  

  
